﻿Option Explicit On ' Make sure all items are explicitly declared
Option Strict On ' Be Very Strict about things here!
Namespace ZuneCardr
    ''' <summary>Theme</summary>
    ''' <author>Comentsys</author>
    ''' <version>1.0.0</version>
    ''' <created>16th February 2009</created>
    ''' <modified>16th February 2009</modified>
    ''' <remarks>Theme Handler</remarks>
    Public Class Theme

        ' Private Constants

        ' Common Colours
        Private ReadOnly ZUNE_WHITE As Color = Colors.White
        Private ReadOnly ZUNE_GREY As Color = Color.FromRgb(88, 88, 88)
        Private ReadOnly ZUNE_BROWN As Color = Color.FromRgb(77, 52, 23)
        Private ReadOnly ZUNE_ORANGE As Color = Color.FromRgb(255, 102, 0)
        Private ReadOnly ZUNE_PINK As Color = Color.FromRgb(255, 1, 154)
        ' Zune 1.0
        Private ReadOnly THEME_ONE_GRADIENT_START As Color = Color.FromRgb(216, 144, 56) ' Orange
        Private ReadOnly THEME_ONE_GRADIENT_END As Color = Color.FromRgb(120, 120, 128) ' Grey
        Private ReadOnly THEME_ONE_FOREGROUND As Color = ZUNE_WHITE
        Private ReadOnly THEME_ONE_BACKGROUND As Color = ZUNE_BROWN
        Private ReadOnly THEME_ONE_BORDER As Color = Color.FromRgb(127, 127, 127) ' Zune Border
        Private ReadOnly THEME_ONE_SECTION_BACKGROUND As Color = Color.FromArgb(200, 136, 126, 146) ' Section BG
        Private ReadOnly THEME_ONE_SECTION_FOREGROUND As Color = ZUNE_WHITE
        Private ReadOnly THEME_ONE_ITEM_FOREGROUND As Color = Color.FromRgb(220, 126, 46)
        ' Zune 2.0
        Private ReadOnly THEME_TWO_GRADIENT_START As Color = ZUNE_ORANGE
        Private ReadOnly THEME_TWO_GRADIENT_END As Color = ZUNE_PINK
        Private ReadOnly THEME_TWO_FOREGROUND As Color = ZUNE_BROWN
        Private ReadOnly THEME_TWO_BACKGROUND As Color = ZUNE_WHITE
        Private ReadOnly THEME_TWO_BORDER As Color = Color.FromRgb(195, 195, 195) ' Very Light Grey
        Private ReadOnly THEME_TWO_SECTION_BACKGROUND As Color = Color.FromArgb(200, 228, 228, 228) ' Section BG
        Private ReadOnly THEME_TWO_SECTION_FOREGROUND As Color = ZUNE_ORANGE
        Private ReadOnly THEME_TWO_ITEM_FOREGROUND As Color = ZUNE_PINK
        ' Zune 3.0
        Private ReadOnly THEME_THREE_GRADIENT_START As Color = ZUNE_ORANGE
        Private ReadOnly THEME_THREE_GRADIENT_END As Color = ZUNE_PINK
        Private ReadOnly THEME_THREE_FOREGROUND As Color = ZUNE_GREY
        Private ReadOnly THEME_THREE_BACKGROUND As Color = ZUNE_WHITE
        Private ReadOnly THEME_THREE_BORDER As Color = Color.FromRgb(216, 216, 216) ' Light Grey
        Private ReadOnly THEME_THREE_SECTION_BACKGROUND As Color = Color.FromArgb(200, 157, 157, 157) ' Section BG
        Private ReadOnly THEME_THREE_SECTION_FOREGROUND As Color = ZUNE_WHITE
        Private ReadOnly THEME_THREE_ITEM_FOREGROUND As Color = ZUNE_PINK
        ' GamerCard
        Private ReadOnly THEME_GAMER_GRADIENT_START As Color = ZUNE_ORANGE
        Private ReadOnly THEME_GAMER_GRADIENT_END As Color = ZUNE_PINK
        Private ReadOnly THEME_GAMER_FOREGROUND As Color = Colors.Black
        Private ReadOnly THEME_GAMER_BACKGROUND As Color = Color.FromRgb(81, 81, 81)
        Private ReadOnly THEME_GAMER_BORDER As Color = Color.FromRgb(174, 174, 174) ' Light Grey
        Private ReadOnly THEME_GAMER_SECTION_BACKGROUND As Color = Color.FromArgb(200, 117, 117, 117) ' Section BG
        Private ReadOnly THEME_GAMER_SECTION_FOREGROUND As Color = ZUNE_WHITE
        Private ReadOnly THEME_GAMER_ITEM_FOREGROUND As Color = Color.FromRgb(55, 55, 55) ' Dark Grey

        ' Private Members

        Private _GradientStart As Color
        Private _GradientEnd As Color
        Private _Foreground As Color
        Private _Background As Color
        Private _Border As Color
        Private _SectionForeground As Color
        Private _SectionBackground As Color
        Private _ItemForeground As Color
        Private _CurrentStyle As Style = Style.Three ' Default

        ' Public Members

        Public Enum Style
            [Default] = 0
            One = 1
            Two = 2
            Three = 3
            GamerCard = 66
            Custom = 99
        End Enum

        ' Private Methods

        ''' <summary>Create</summary>
        ''' <param name="GradientStart">GradientStart Colour</param>
        ''' <param name="GradientEnd">GradientEnd Colour</param>
        ''' <param name="Foreground">Foreground Colour</param>
        ''' <param name="Background">Background Colour</param>
        ''' <param name="Border">Border Colour</param>
        ''' <param name="SectionForeground">SectionForeground Colour</param>
        ''' <param name="SectionBackground">SectionBackground Colour</param>
        ''' <param name="ItemForeground">ItemForeground Colour</param>
        ''' <remarks>Assigns Colours to Values</remarks>
        Private Sub Create(ByVal GradientStart As Color, ByVal GradientEnd As Color, _
               ByVal Foreground As Color, ByVal Background As Color, ByVal Border As Color, _
               ByVal SectionForeground As Color, ByVal SectionBackground As Color, _
               ByVal ItemForeground As Color)
            Me.GradientStart = GradientStart
            Me.GradientEnd = GradientEnd
            Me.Foreground = Foreground
            Me.Background = Background
            Me.Border = Border
            Me.SectionForeground = SectionForeground
            Me.SectionBackground = SectionBackground
            Me.ItemForeground = ItemForeground
        End Sub

        ''' <summary>ThemeOne</summary>
        ''' <remarks>Helper Function</remarks>
        Private Sub ThemeOne()
            Create(THEME_ONE_GRADIENT_START, THEME_ONE_GRADIENT_END, _
                   THEME_ONE_FOREGROUND, THEME_ONE_BACKGROUND, THEME_ONE_BORDER, _
                   THEME_ONE_SECTION_FOREGROUND, THEME_ONE_SECTION_BACKGROUND, THEME_ONE_ITEM_FOREGROUND)
        End Sub

        ''' <summary>ThemeTwo</summary>
        ''' <remarks>Helper Function</remarks>
        Private Sub ThemeTwo()
            Create(THEME_TWO_GRADIENT_START, THEME_TWO_GRADIENT_END, _
                   THEME_TWO_FOREGROUND, THEME_TWO_BACKGROUND, THEME_TWO_BORDER, _
                   THEME_TWO_SECTION_FOREGROUND, THEME_TWO_SECTION_BACKGROUND, THEME_TWO_ITEM_FOREGROUND)
        End Sub

        ''' <summary>ThemeThree</summary>
        ''' <remarks>Helper Function</remarks>
        Private Sub ThemeThree()
            Create(THEME_THREE_GRADIENT_START, THEME_THREE_GRADIENT_END, _
                   THEME_THREE_FOREGROUND, THEME_THREE_BACKGROUND, THEME_THREE_BORDER, _
                   THEME_THREE_SECTION_FOREGROUND, THEME_THREE_SECTION_BACKGROUND, THEME_THREE_ITEM_FOREGROUND)
        End Sub

        ''' <summary>ThemeGamer</summary>
        ''' <remarks>Helper Function</remarks>
        Private Sub ThemeGamer()
            Create(THEME_GAMER_GRADIENT_START, THEME_GAMER_GRADIENT_END, _
                   THEME_GAMER_FOREGROUND, THEME_GAMER_BACKGROUND, THEME_GAMER_BORDER, _
                   THEME_GAMER_SECTION_FOREGROUND, THEME_GAMER_SECTION_BACKGROUND, THEME_GAMER_ITEM_FOREGROUND)
        End Sub

        ' Public Methods

        ''' <summary>Constructor</summary>
        ''' <remarks>Start with Theme Three</remarks>
        Public Sub New()
            ThemeThree() ' Default Style is Theme Three
        End Sub

        ''' <summary>Theme</summary>
        ''' <param name="Style">Theme Style</param>
        ''' <remarks>Sets the Theme by Style</remarks>
        Public Sub Theme(ByRef Style As Style)
            CurrentStyle = Style ' Update Current Style
            Select Case Style
                Case ZuneCardr.Theme.Style.One
                    ThemeOne() ' Zune 1.0
                Case ZuneCardr.Theme.Style.Two
                    ThemeTwo() ' Zune 2.0
                Case ZuneCardr.Theme.Style.Three, ZuneCardr.Theme.Style.Default
                    ThemeThree() ' Zune 3.0
                Case ZuneCardr.Theme.Style.GamerCard
                    ThemeGamer() ' GamerCard
                Case ZuneCardr.Theme.Style.Custom
                    ' Do Nothing
            End Select
        End Sub

        ' Public Properties

        ''' <summary>GradientStart</summary>
        ''' <value>Color</value>
        ''' <returns>GradientStart Colour</returns>
        Public Property GradientStart() As Color
            Get
                Return _GradientStart
            End Get
            Set(ByVal Value As Color)
                _GradientStart = Value
            End Set
        End Property

        ''' <summary>GradientEnd</summary>
        ''' <value>Color</value>
        ''' <returns>GradientEnd Colour</returns>
        Public Property GradientEnd() As Color
            Get
                Return _GradientEnd
            End Get
            Set(ByVal Value As Color)
                _GradientEnd = Value
            End Set
        End Property

        ''' <summary>Foreground</summary>
        ''' <value>Color</value>
        ''' <returns>Foreground Colour</returns>
        Public Property Foreground() As Color
            Get
                Return _Foreground
            End Get
            Set(ByVal Value As Color)
                _Foreground = Value
            End Set
        End Property

        ''' <summary>Background</summary>
        ''' <value>Color</value>
        ''' <returns>Background Colour</returns>
        Public Property Background() As Color
            Get
                Return _Background
            End Get
            Set(ByVal Value As Color)
                _Background = Value
            End Set
        End Property

        ''' <summary>Border</summary>
        ''' <value>Color</value>
        ''' <returns>Border Colour</returns>
        Public Property Border() As Color
            Get
                Return _Border
            End Get
            Set(ByVal Value As Color)
                _Border = Value
            End Set
        End Property

        ''' <summary>SectionForeground</summary>
        ''' <value>Color</value>
        ''' <returns>SectionForeground Colour</returns>
        Public Property SectionForeground() As Color
            Get
                Return _SectionForeground
            End Get
            Set(ByVal Value As Color)
                _SectionForeground = Value
            End Set
        End Property

        ''' <summary>SectionBackground</summary>
        ''' <value>Color</value>
        ''' <returns>SectionBackground Colour</returns>
        Public Property SectionBackground() As Color
            Get
                Return _SectionBackground
            End Get
            Set(ByVal Value As Color)
                _SectionBackground = Value
            End Set
        End Property

        ''' <summary>ItemForeground</summary>
        ''' <value>Color</value>
        ''' <returns>ItemForeground Colour</returns>
        Public Property ItemForeground() As Color
            Get
                Return _ItemForeground
            End Get
            Set(ByVal Value As Color)
                _ItemForeground = Value
            End Set
        End Property

        ''' <summary>CurrentStyle</summary>
        ''' <value>Style</value>
        ''' <returns>Current Style</returns>
        Public Property CurrentStyle() As Style
            Get
                Return _CurrentStyle
            End Get
            Set(ByVal Value As Style)
                _CurrentStyle = Value
            End Set
        End Property

    End Class
End Namespace
